<include file="public@header" />
</head>
<body>
    <div class="layui-fluid js-check-wrap">
        <form class="layui-form js-ajax-form margin-top-20" action="{:url('rbac/roleeditpost')}" method="post">
            <div class="layui-card">
                <div class="layui-card-header">{:lang('ADMIN_RBAC_ROLEEDIT')}</div>
                <div class="layui-card-body">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="form-required">*</span>{:lang('ROLE_NAME')}</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" id="input-name" name="name" value="{$data.name}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('ROLE_DESCRIPTION')}</label>
                        <div class="layui-input-block">
                            <textarea type="text" class="layui-textarea" id="input-remark" name="remark">{$data.remark}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('STATUS')}</label>
                        <div class="layui-input-block">
                            <php>
                                $active_true_checked  = ($data['status']==1)?"checked":"";
                                $active_false_checked = ($data['status']==0)?"checked":"";
                            </php>
                            <input type="radio" name="status" value="1" title="{:lang('ENABLED')}" {$active_true_checked}>
                            <input type="radio" name="status" value="0" title="{:lang('DISABLED')}" $active_false_checked>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="id" value="{$data.id}"/>
                            <if condition="cmf_auth_check(cmf_get_current_admin_id(), 'admin/Rbac/roleAddPost')">
                                <button type="submit" class="layui-btn layui-btn-normal js-ajax-submit">{:lang('SAVE')}</button>
                            </if>
                            <a class="layui-btn layui-btn-primary" href="{:url('admin/rbac/index')}">{:lang('BACK')}</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

<include file="public@footer" />
